var promisify = function (fn) {
    return async function () {
       let result = null
       try{
          fn.call(this, {
             success: function(res) {
                result = res 
             },
             fail: function(err) {
                result = err
             }
          })
          return result
       }catch(e){
          return null
       }
    }
 }
 